 
 

  -            /++.
             .

  

    -  : https://agner.org
   ,   ,  Intel  SIMD-     :
https://www.agner.org/optimize/


 

       .
      ,    ,    ,     .
           .

To be done

 

  -        / .
   .       ,     (   ).
     (!)          ,   
      ,      .
   (  )    ,      (  ),
        ( -,    ).
 , ,         ,     .
     (..     ).
    "     ",  .

 C++      :
1. relaxed:   ,     .    - .
-   ""     
-  thread2 ""          ,         thread1
-       thread1     thread2
relaxed-       .
      .
     - READ UNCOMMITTED
2. sequential consistency, seq_cst:       .
-        thread1    thread2
-             .
        
-    (    )   thread1,  store   ,
      load      thread2
      .
     - SERIALIZED
3. acquire/release:  .
-     release      ,        acquire
-      thread1,      release, 
           acquire   thread2
-            release    thread1, 
           acquire    thread2
       (      1  2).

https://habr.com/ru/post/517918/
https://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync
https://habr.com/ru/company/JetBrains-education/blog/523298/
https://habr.com/ru/post/545996/
https://habr.com/ru/post/546222/
https://habr.com/ru/post/546880/
https://elixir.bootlin.com/linux/latest/source/Documentation/memory-barriers.txt

    

     x86/x64 -  .
        ,   x64 :   .

         -    ,  ()     .
  -:
-   
-   (,  ,     )
-    ,      ()

      ,    ,
    .
  ,      ,          ,
  .

,    ,     64   :)

   :    ,    ,    .

 ++  chrono::high_resolution_timer.    ,          .
      Linux / Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz / gcc 8.4,    30 .
 Intel Core i5 480M @ 2.67GHz / Windows 7 / MSVC 2017   4000 .
 Intel Atom x7-Z8750 @ 1.6GHz / Windows 10 / MSVC 2017  320 .

 x64       Timestamp Counter (TSC) -     64  MSR.
  ,            .
         .
         constant_tsc  /proc/cpuinfo.
    RDTSC/RDTSCP,        .
       :   ,    ,
   (  -   ).

  :
1.    RDTSC    * :
-      ,      
2.  (**)   :
-   ,      ***
3.      ,     1  2.
4.     RDTSC,    RDTSC
5.   .
*   ,  RDTSC   - -   ,  .
**        ,  -     
  ,   -       .
https://stackoverflow.com/questions/42189976/calculate-system-time-using-rdtsc
    ,   ,     .
***        sleep  /,   .

 :
-        RDTSC :
    ,        .
 ,         ,    .
-   -     ,       .
         -     ,
      (   ).
-   -         
-   -  .

 ,  .
      ,         
 ,     .

  x86        Performance Monitoring Unit (PMU),
       ( Coreclock register)

     

  .       ;      .
 MS DOS     ;  RT-11     -.
    ,  .
   ,    .
       .

 realtime-  Linux,     ,    
      .       .
       : https://habr.com/ru/post/562636/

          Linux -      (thread affinity).
           .
         (   ).
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_for_real_time/8/html/tuning_guide/chap-general_system_tuning


 

   (  )     Kernel Bypass:
    ,  userland.        SolarFlare (  OnLoading).
  TCP/IP   ,    .
    ,     ;          (iptables)   .
     kernel/user,   (        - ),
 ,        , .
       (.)   .
       .
      .

Bonding .

     RDMA -      (   ).
             ,
   ,     (    ).
    ,           (,   ).
  - Infiniband,  libibverbs.
  interlinked-,  .

    -     (zero copy).
      **    .
 100   .
           / .

  (SHADOW BUFFERING/DOUBLE BUFFERING)

       ( ,    )   :
-   ,      (  )    
-       
-       
-      ,    ;      .

     .



     
https://habr.com/ru/post/523654/

     -ffast-math  GCC 11
https://habr.com/ru/company/ruvds/blog/586386/

  double
https://habr.com/ru/company/ruvds/blog/542640/
https://github.com/fastfloat/fast_float

  UTF8
https://habr.com/ru/company/ruvds/blog/551060/
https://arxiv.org/pdf/2010.03090.pdf

ASM today
https://habr.com/ru/post/544786/

     
https://habr.com/ru/company/otus/blog/557310/

epoll  Windows IO Completion Ports:  
https://habr.com/ru/company/infopulse/blog/415403/

    ?   x86  M1
https://habr.com/ru/company/selectel/blog/557410/


1. Agner Fog, Optimization manuals https://www.agner.org/optimize/
2.      https://habr.com/ru/company/otus/blog/343566/
3. select / poll / epoll:   https://habr.com/ru/company/infopulse/blog/415259/
4. Evaluating the Cost of Atomic Operations onModern Architectures https://spcl.inf.ethz.ch/Publications/.pdf/atomic-bench.pdf
5. Intel Intrinsics Guide https://software.intel.com/sites/landingpage/IntrinsicsGuide/
6. Neon Intrinsics Reference https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics


https://easyperf.net/notes/
http://scrutator.me/

